#include<bits/stdc++.h>
using namespace std;


int n;
int main()
{
    cin>>n;
    vector<int>nums(3*n,0);
    for(auto&ch:nums)cin>>ch;
    sort(nums.begin(),nums.end());
    long long int sum=0;
    
    int index=3*n-2;
    while(n--)
    {
        sum+=nums[index];
        index-=2;
    }
    cout<<sum<<endl;
    return 0;
}